package com.store.bookstore_backend.web.controller;

import com.store.bookstore_backend.domain.Categories;
import com.store.bookstore_backend.dto.APIResponse;
import com.store.bookstore_backend.service.CategoriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    CategoriesService categoriesService;

    @GetMapping("/list")
    public APIResponse<List<Categories>> list() {
        return APIResponse.success(categoriesService.getAllCategories());
    }


}

